package com.example.com.netty;
import com.example.com.netty.listen.NettyClientListen;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.InetSocketAddress;

/**
 * @author 杜豪波
 * @description: TODO
 * @date 2020/1/3 14:03
 */
public class NettyClient extends NettyBase{
    private static final Logger logger = LoggerFactory.getLogger(NettyClient.class);

    public static void clientStart(String ip,int port,String conType){
        // 服务器开启端口
        InetSocketAddress serviceIsa = new InetSocketAddress(ip, port);
        if (REQ_TCP.equalsIgnoreCase(conType)) {
            new NettyClientListen().initUDP(serviceIsa);
        }else if (REQ_UDP.equalsIgnoreCase(conType)) {
            new NettyClientListen().initTCP(serviceIsa);
        }
    }


}
